package com.hyt.it.ogt.ykcj.common.enums.zs;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 证书发放状态：1-已发放，2-未发放
 * @Author: STARF
 * @CreateDate: 2022/06/24 15:33
 **/
@Getter
@AllArgsConstructor
public enum CertificateProvideStatusEnums {

    NONE(0, "未知"),
    PROVIDED(1, "已生成"),
    UNPROVIDED(2, "未生成"),
    ;

    private final Integer code;
    private final String desc;

    public static CertificateProvideStatusEnums getByCode(Integer code) {
        for (CertificateProvideStatusEnums enums : values()) {
            if (enums.getCode().equals(code)) {
                return enums;
            }
        }
        return NONE;
    }

    public static String getDescByCode(Integer code) {
        for (CertificateProvideStatusEnums enums : values()) {
            if (enums.getCode().equals(code)) {
                return enums.getDesc();
            }
        }
        return NONE.getDesc();
    }

}
